import java.util.Scanner;

public class GetNumTest {
    public static void main(String[] args) {
        Scanner input =new Scanner(System.in);
        System.out.println("请输入4位数");
        int num =input.nextInt();
        int qian = num/1000;
        int bai =num%1000/100;//8349%1000=349/100=3
        int shi =num%100/10;//8349%100=49/10=4
        int ge  =num%10;//8349%10=9
        int sum =qian+bai+shi+ge;
        System.out.println("千位");
        System.out.println("百位");
        System.out.println("十位");
        System.out.println("各个位相加之和");
    }
}
